<?php
include_once('admin-load.php');
	$client_id = isset($_REQUEST['client_id']) ? $_REQUEST['client_id'] : null;
        $clients='';
     if ($client_id) {       
       $query = "SELECT * FROM clients WHERE id = $client_id";
       $clients = $dbna->get_row($query);
            
     }

    if (isset($_POST['submit_form'])) {
        update_clients();
    }
?>
<?php 
	include_once 'header.php';
?>
            <div id="main_content">
                            <div id="content">
                    
		</div>
        <div class="container">
            <h5>Edit New Client</h5>

        </div>
				<div id="main">
                    <h2>Edit New Client</h2>
                    <form id="add_user" action="client.php" method="post">
                        <input type="hidden" value="<?php echo $client_id ?>" name="$client_id"/>
                        <input type="hidden" value="1" name="submit_form"/>
                        <fieldset>
                            <legend>Form Edit Client</legend>
                        <div>
                            <label for="company_name"> Company name: </label>
                            <input type="text" id="company_name" name="company_name" value="<?php echo $clients-> company_name ?>"/>
                        </div>
                        <div>
                            <label for="Phone">Phone: </label>
                            <input type="text" id="phone" name="phone" value="<?php echo $clients-> phone ?>"/>
                        </div>
                        <div>
                            <label for="fax">Fax: </label>
                            <input type="text" id="fax" name="fax" value="<?php echo $clients-> fax ?>"/>
                        </div>
                        <div>
                            <label for="address">Address:</label>
                            <input type="text" id="address" name="address"value="<?php echo $clients-> address ?>"/>
                        </div>
                        <div>
                            <label for="Country">Country:</label>
                            <?php echo countrySelect ($clients-> country) ?>
                        </div>
                            <div>
                            <label for="zip_cod">Zip code:</label>
                            <input type="text" id="zip_code" name="zip_code"value="<?php echo $clients-> zip_code ?>"/>
                        </div>
                              <div>
                                <label for="client">Client's company:</label>
                                <select name="client">
                                  <option selected="selected">AM</option><option>PM</option> <?php echo $options ?>
                                </select>
                            </div>

                         <div class="buttons">
                            <input type="submit" value="update" name="submit"/>   
                        </div>
                    </form>
                </div>
            </div>
      <?php 
	include_once 'footer.php';
?>      